package com.vo;

import com.bean.Sales;

import java.io.Serializable;

public class SalesVo implements Serializable {
    private String id;
    private String name;
    private String content;
    private String num;
    private String commodityId;
    private String state;
    private String spare;

    public Sales parse(){
        Sales s = new Sales();
        try {
            s.setId(Integer.valueOf(this.id));
        } catch (NumberFormatException e) {

        }
        try {
            s.setNum(Integer.valueOf(this.num));
        } catch (NumberFormatException e) {

        }
        try {
            s.setCommodityId(Integer.valueOf(this.commodityId));
        } catch (NumberFormatException e) {

        }
        try {
            s.setState(Integer.valueOf(this.state));
        } catch (NumberFormatException e) {

        }
        try {
            s.setSpare(Integer.valueOf(this.spare));
        } catch (NumberFormatException e) {

        }
        s.setName(this.name);
        s.setContent(this.content);
        return s;
    }

    @Override
    public String toString() {
        return "SalesVo{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", content='" + content + '\'' +
                ", num='" + num + '\'' +
                ", commodityId='" + commodityId + '\'' +
                ", state='" + state + '\'' +
                ", spare='" + spare + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(String commodityId) {
        this.commodityId = commodityId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getSpare() {
        return spare;
    }

    public void setSpare(String spare) {
        this.spare = spare;
    }
}
